package com.kingbook.common.listener;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

@Component
public class CustomLaunchListener implements ApplicationListener<ContextRefreshedEvent> {

    private static Logger logger = LoggerFactory.getLogger(CustomLaunchListener.class);

//    ILauncher[] launchers;
//
//    public CustomLaunchListener(ILauncher... launchers) {
//        this.launchers = launchers;
//    }

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        try {
            logger.info("----> 开始加载系统配置信息... ");
//            for (ILauncher iLauncher : launchers) {
//                iLauncher.launcher(event.getApplicationContext());
//            }
            logger.info("----> 结束加载系统配置信息... ");

        } catch (Exception e) {
            logger.error("初始化失败...", e);
        }
    }


//    public void setLaunchers(ILauncher[] launchers) {
//        this.launchers = launchers;
//    }


}
